{{ $shouldRender := or .Sections .RegularPages }}
{{ $hasSections := .Sections }}

{{ if $shouldRender }}

<div class="container">
  {{ with .Sections }}
  <p class="title is-size-4 is-size-5-mobile has-text-weight-light">
    Subsections
  </p>

  <div class="columns is-variable is-1 is-multiline">
    {{ range . }}
    {{ .Render "section-card" }}
    {{ end }}
  </div>
  {{ end }}

  {{ with .RegularPages }}
  <p class="title is-size-4 is-size-5-mobile has-text-weight-light{{ if $hasSections }} mt-4{{ end }}">
    Pages in this section
  </p>

  <div class="columns is-variable is-1 is-multiline">
    {{ range . }}
    {{ .Render "section-card" }}
    {{ end }}
  </div>
  {{ end }}
</div>
{{ end }}